package interfaces;

public class Factories {

	public Factories() {
		// TODO 自动生成的构造函数存根
	}
	public static void serviceConsumer(ServiceFactory fact) {
		Service s = fact.getService();
		s.method1();
		s.method2();
	}
	public static void main(String[] args) {
		// TODO 自动生成的方法存根
		serviceConsumer(new Service1Factory());
		serviceConsumer(new Service2Factory());

	}

}
